package com.hhit.zhgd.service.impl

import com.hhit.zhgd.domain.entity.ZhgdDictionary
import com.hhit.zhgd.service.ZhgdDictionaryService
import org.junit.jupiter.api.Test

import org.junit.jupiter.api.Assertions.*
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest

@SpringBootTest
internal class ZhgdDictionaryServiceImplTest {

    @Autowired
    private val zhgdDictionaryService: ZhgdDictionaryService? = null

    @Test
    fun getDictionaryPageInfo() {
        zhgdDictionaryService?.getDictionaryPageInfo("执行中", 1, 1)?.records?.forEach { println(it) }
    }

    @Test
    fun getDictionaryByPCode() {
        zhgdDictionaryService?.getDictionaryByPCode("quality_acceptance_plan_status")?.forEach { println(it) }
    }

    @Test
    fun addDictionary() {
        zhgdDictionaryService?.addDictionary(
            ZhgdDictionary(
                code = "test",
                parentCode = "test",
                value = "test",
                remark = "test"
            )
        )
    }

    @Test
    fun editDictionary() {
        zhgdDictionaryService?.editDictionary(ZhgdDictionary(id = 29, value = "test11111", parentCode = ""))
    }

    @Test
    fun delDictionary() {
        zhgdDictionaryService?.delDictionary(29)
    }
}